import prompt from '@system.prompt';

export default {
    data: {
        todolistleft: [],
        todolistright: [],
        itemBtnArr:[//侧滑按钮定义
            {
                name:'编辑',
                background:'#00aaff',
                color:'#000000',
                width:80,
            },
            {
                name:'删除',
                background:'#ff5500',
                color:'#fffffff',
                width:120,
            },
            {
                name:'收藏',
                background:'#f1215c',
                color:'#868282',
                width:80,
            }
        ],
    },
    onInit() {
        for (var i = 0; i < 4; i++) {
            var items = {
                date : '2021-12-31 20:00:0'+i,
                title : "item ",
                itemMoveX:0,
            }
            this.todolistleft.push(items);
            this.todolistright.push(items);
        }


    },
    itemClick(e){
        prompt.showToast({
            message: e.detail.itemobj.title + e.detail.index +" "+ e.detail.itemobj.date
        })
    },
    itemBtnClick(e){
        prompt.showToast({
            message:"item "+e.detail.index +" "+ e.detail.btnObj.name
        })
    }

}
